<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
  </head>
  <body>
    <button class="get">GET</button>
    <button class="delete">DELETE</button>
    <button class="head">HEAD</button>
    <button class="put">PUT</button>
    <button class="post">POST</button>
    <button class="patch">PATCH</button>
  </body>
</html>

<script>
  let instance = ajaxp.create({
    baseURL: 'http://localhost:3000'
  })

  document.querySelectorAll('button').forEach((ele) => {
    ele.onclick = function() {
      instance[ele.className]('students').then((res) => {
        console.log(res)
      })
    }
  })
</script>
